package com.test.demo;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
		
		System.out.println(">>>>>>>>>>>>>>>>");
		
		try {
            Class.forName("com.mysql.jdbc.Driver");
            String url = String.format("jdbc:mysql://%s:%s/%s", args[0],args[1],args[2]);
            String user = args[3];
            String password = args[4];
            //建立连接
            Connection conn = DriverManager.getConnection(url, user, password);
            
            if(conn == null) {
                System.out.println("failed.......................");
            }else {
                System.out.println("success.......................");
            }
            
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
		
		
	}

}
